from thrift.transport import TSocket, TTransport
from thrift.protocol import TBinaryProtocol

from com.tuling import UserService

transport = TSocket.TSocket('localhost', 9090)

transport.setTimeout(600)

transport = TTransport.TBufferedTransport(transport)

protocol = TBinaryProtocol.TBinaryProtocol(transport)

client = UserService.Client(protocol)

#建立连接
transport.open()

result = client.getById(1)

print(result)